function hex2str(hex) {
    var s = '';
    for(var i=0; i < hex.length/2; i++) {
        var val = parseInt(hex.slice(2*i, 2*i+2), 16)
        s += String.fromCharCode(val);
    }
    return s
}

function hex2arr(hex) {
    var s = [];
    for(var i=0; i < hex.length/2; i++) {
        var val = parseInt(hex.slice(2*i, 2*i+2), 16)
        s.push(val);
    }
    return s
}

function str2arr(str) {
    var arr = [];
    for(var i=0; i < str.length; i++) {
        arr.push(str.charCodeAt(i));
    }
    return arr;
}

function ab2hex(ab) {
    var accum = [];
    var len = ab.byteLength | ab.length;
    for(var i=0; i < len; i++) {
        accum.push(hexpad(ab[i].toString(16)));
    }
    return accum.join('');
}

function b32decode(input) {
    var decoder = new Decoder()
    var output = decoder.update(input, true)
    return output
}